package com.zjitc.config;

import com.zjitc.obj.Teacher;
import com.zjitc.obj.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/6 15:56
 * @description:
 */

@Configuration
public class JavaConfigDemo1 {

  @Bean
  public User user(){
    User user = new User("default name",12);
    return user;
  }

  @Bean
  public Teacher teacher(User user){
    return new Teacher(user);
  }
}
